/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function LoginValidation(){
    var username = document.getElementById("username").value;
    var password = document.getElementById("password").value;
    var isValid = 1;
    var and = "AND";
    var or = "OR";
    
//    alert(username.indexOf("<"));
    if(username.indexOf("<") > -1 || password.indexOf("<") > -1)
        isValid = 0;
    else if(username.indexOf(">") > -1 || password.indexOf(">") > -1)
        isValid = 0;
    else if(username.indexOf("\"") > -1 || password.indexOf("\"") > -1)
        isValid = 0;
    else if(username.indexOf("/")> -1 || password.indexOf("/") > -1)
        isValid = 0;
    else if(username.indexOf(":") > -1 || password.indexOf(":") > -1)
        isValid = 0;    
    else if(username.indexOf(";") > -1 || password.indexOf(";") > -1)
        isValid = 0;
    else if(username.indexOf("=") > -1 || password.indexOf("=") > -1)
        isValid = 0;
    else if(username.indexOf("|") > -1 || password.indexOf("|") > -1)
        isValid = 0;

    
    if(isValid == 1){
        return true;
        
    }
    else {
        document.getElementById("err").innerHTML = '*Login input is invalid. Special characters are not allowed.';
//        document.write('<span class="errLog">Login input is invalid. Special characters are not allowed.</span>');
        return false;
    }
}

